/**
 * Copyright (C), 2020, 安徽贝慕信息科技有限公司
 * FileName: GatewayCommonConstants
 * Author:   Allen
 * Date:     2020/8/25
 * Description: 默认网关项目常用常量类
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.bim.marvel.gateway.client.constant;

/**
 * 〈默认网关项目常用常量类〉
 *
 * @author Allen
 * @date 2020/8/25
 * @since 1.0.0
 */
public class GatewayCommonConstants {

    /**
     * Gateway_Order顺序
     */
    public static final Integer GATEWAY_ORDER = -200;
    /**
     * OPEN API redis键值前缀
     */
    public static final String GET_OPEN_API_URI = "getOpenApiUri::openApiUrl:";
    /**
     * OPEN API redis键值联接符
     */
    public static final String GET_OPEN_API_CONNECTOR = "_";
    /**
     * OPEN APP KEY redis键值前缀
     */
    public static final String GET_APP_KEY_INFO = "getAppDetailInfo::appInfo:";

    /**
     * 请求时间开始计时常量
     */
    public static final String REQUEST_TIME_BEGIN = "requestTimeBegin";

    /**
     * client_id参数
     */
    public static final String REQUEST_APP_ID_PARAMETER_NAME = "app_id";
    /**
     * sessionKey参数
     */
    public static final String REQUEST_SESSION_KEY_PARAMETER_NAME = "session_key";
    /**
     * 时间戳
     */
    public static final String REQUEST_TIMESTAMP_PARAMETER_NAME = "timestamp";
    /**
     * 签名的摘要算法，可选值为：hmac，md5
     */
    public static final String REQUEST_SIGN_METHOD_PARAMETER_NAME = "sign_method";
    /**
     * API输入参数签名结果
     */
    public static final String REQUEST_SIGN_PARAMETER_NAME = "sign";
    /**
     * 请求方法
     */
    public static final String REQUEST_HTTP_METHOD_PARAMETER_NAME = "http_method";
    /**
     * POST请求
     */
    public static final String POST_HTTP_METHOD = "POST";
    /**
     * 请求路径
     */
    public static final String REQUEST_URI_PARAMETER_NAME = "request_uri";
    /**
     * 请求资源ID
     */
    public static final String REQUEST_SERVICE_ID = "service_id";
    /**
     * 有效时间误差，默认为10分钟。
     */
    public static final Integer EFFECTIVE_TIME = 10;

    /**
     * 一千毫秒
     */
    public static final int ONE_THOUSAND_MILLISECONDS = 1000;
    /**
     * 参数签名默认有效时间间隔，允许客户端请求最大时间误差为10分钟
     */
    public static final int DEFAULT_TIMESTAMP_VALIDITY = 600000;

    /**
     * url签名有效时间间隔
     */
    public static final int TIMESTAMP_VALIDITY = DEFAULT_TIMESTAMP_VALIDITY;
}
